package geektime.spring.reactivespringbucks.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import geektime.spring.reactivespringbucks.Serializer.MoneyDeserializer;
import geektime.spring.reactivespringbucks.Serializer.MoneySerializer;
import java.io.Serializable;
import java.util.Date;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.joda.money.Money;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Table;


@Table("t_coffee")
@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Coffee implements Serializable {

  private static final long serialVersionUID = -4313554536751530305L;
  @Id
  private Long id;
  private String name;
  @JsonSerialize(using = MoneySerializer.class)
  @JsonDeserialize(using = MoneyDeserializer.class)
  private Money price;
  private Date createTime;
  private Date updateTime;
}


